import BaseInput from "@/components/ProForm/BaseInput.vue";
import BaseCascader from '@/components/ProForm/BaseCascader.vue'
import BaseCheckBox from '@/components/ProForm/BaseCheckBox.vue'
import BaseColorPicker from '@/components/ProForm/BaseColorPicker.vue'
import BaseDatePicker from '@/components/ProForm/BaseDatePicker.vue'
import BaseDateTimePicker from '@/components/ProForm/BaseDateTimePicker.vue'
import BaseInputNumber from '@/components/ProForm/BaseInputNumber.vue'
import BaseSelect from '@/components/ProForm/BaseSelect.vue'
import BaseSwitch from '@/components/ProForm/BaseSwitch.vue'
import BaseTimePicker from '@/components/ProForm/BaseTimePicker.vue'
import BaseTimeSelect from '@/components/ProForm/BaseTimeSelect.vue'
import BaseUpload from '@/components/ProForm/BaseUpload.vue'
import BaseDropdown from '@/components/ProForm/BaseDropdown.vue'
import { reactive } from "vue";




const options = []
export const addeditConfig = {
    formProps: { // 表单属性
        labelPosition: 'left',
        labelWidth: 'auto',
        row:true,
    },
    formItems: [{
            name: BaseInput,
            props: { 
                label: '產品名稱',
                prop: 'name',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: '' 
        },
       {
                name: BaseSelect,
                options: options,
                props: {
                    label: '產品分類',
                    prop: 'products_type_id',
                    span: 12,
                },
                elProps: {
                    placeholder: '',
                    clearable: true,
                    multiple: false,
                },
                value: ''
        },
        {
            name: BaseSelect,
            options: options,
            props: {
                label: '產品品牌',
                prop: 'brand_id',
                span: 12,
            },
            elProps: {
                placeholder: '',
                clearable: true,
                multiple: false,
            },
            value: ''
        },
        {
            name: BaseSelect,
            options: options,
            props: {
                label: '單位',
                prop: 'unit_id',
                span: 12,
            },
            elProps: {
                placeholder: '',
                clearable: true,
                multiple: false,
            },
            value: ''
        },
        {
            name: BaseInput,
            props: { 
                label: '條形碼',
                prop: 'barcode',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: '' 
        },  
        {
            name: BaseInput,
            props: { 
                label: '型號',
                prop: 'type',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: '' 
        },  
        {
            name: BaseInput,
            props: { 
                label: '價格',
                prop: 'price',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                type:'number',
                placeholder: '',
                clearable:true,
            },
            value: '' 
        },  
        {
            name: BaseInput,
            props: { 
                label: '成本',
                prop: 'cost',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                type:'number',
                placeholder: '',
                clearable:true,
            },
            value: '' 
        },  
        {
            name: BaseInput,
            props: { 
                label: '備註',
                prop: 'cost',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                type:'textarea',
                placeholder: '',
                clearable:true,
            },
            value: '' 
        },  
        {
            name: BaseSelect,
            options: [{
                    value: 1,
                    label: '正常',
                },
                {
                    value: -1,
                    label: '禁用',
                },
            ],
            props: {
                label: '狀態',
                prop: 'status',
                span: 12,
            },
            elProps: {
                placeholder: '',
                clearable: true,
                multiple: false,
            },
            value: ''
        },
        {
            name: BaseInput,
            props: { 
                label: '安全量',
                prop: 'safety',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                type:'number',
                placeholder: '',
                clearable:true,
            },
            value: '' 
        }, 
        {
            name: BaseSelect,
            options:options,
            props: {
                label: '供應商',
                prop: 'supplier_id',
                span: 12,
            },
            elProps: {
                placeholder: '',
                clearable: true,
                multiple: false,
            },
            value: ''
        },
        {
            name: BaseInput,
            props: { 
                label: '維修期',
                prop: 'maintain',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: '' 
        }, 
        {
            name: BaseInput,
            props: { 
                label: '介绍',
                prop: 'introduce',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: '' 
        }, 
        {
            name: BaseInput,
            props: { 
                label: '计算库存状态',
                prop: 'numstatus',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: '' 
        }, 
        {
            name: BaseInput,
            props: { 
                label: '限时优惠状态',
                prop: 'discountstatus',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: '' 
        }, 

        {
            name:BaseDateTimePicker,
            props: {
                label: '開始時間',
                prop: 'starttime',
                span: 12,
            },
            elProps: {
                placeholder: '',
                clearable: true,
                startPlaceholder: "開始時間",
                type:"datetime",
                endPlaceholder: "結束時間",
                format: "YYYY-MM-DD HH:mm:ss",
                valueFormat: "YYYY-MM-DD HH:mm:ss",
            },
            value: ''
        },
        {
            name:BaseDateTimePicker,
            props: {
                label: '結束時間',
                prop: 'endtime',
                span: 12,
            },
            elProps: {
                placeholder: '',
                clearable: true,
                startPlaceholder: "開始時間",
                type:"datetime",
                endPlaceholder: "結束時間",
                format: "YYYY-MM-DD HH:mm:ss",
                valueFormat: "YYYY-MM-DD HH:mm:ss",
            },
            value: ''
        },

        {
            name: BaseInput,
            props: { 
                label: '折扣價',
                prop: 'discountprice',
                borderBottom: true,
                span:12,
            },
            elProps: { 
                placeholder: '',
                clearable:true,
            },
            value: ''
        },
       
    ],
    rules: {
        name:{required:true,message:'请输入產品名稱',trigger: ['blur', 'change']},
        products_type_id:{required:true,message:'请選擇產品分類',trigger: ['blur', 'change']},
        brand_id:{required:true, message:'请選擇品牌',trigger: ['blur', 'change']},
        unit_id:{required:true,message:'请選擇單位',trigger: ['blur', 'change']},
        barcode:{required:true,message:'请輸入產品條形碼',trigger: ['blur', 'change']},
        price:{required:true,message:'请輸入產品價格',trigger: ['blur', 'change']},
        cost:{required:true,message:'请輸入產品成本',trigger: ['blur', 'change']},
        status:{required:true,message:'请選擇產品狀態',trigger: ['blur', 'change']},
        safety:{required:true, message:'请輸入產品安全量',trigger: ['blur', 'change']},
        supplier_id:{ required:true,message:'请產品供應商', trigger: ['blur', 'change']},
        introduce:{required:true,message:'请输入產品介紹',trigger: ['blur', 'change']},
    }
}
